﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DDDSample.Domain.Model.Handling
{
	public static class HandlingEventTypeExtension
	{
		/// <summary>
		/// 
		/// </summary>
		/// <param name="type"></param>
		/// <returns>True if a carrier movement association is required for this event type.</returns>
		public static bool RequiresCarrierMovement(this HandlingEvent.EventType type)
		{
			switch (type)
			{
				case HandlingEvent.EventType.Load:
				case HandlingEvent.EventType.Unload:
					return true;
				default:
					return false;
			}
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="type"></param>
		/// <returns>True if a carrier movement association is prohibited for this event type.</returns>
		public static bool ProhibitsCarrierMovement(this HandlingEvent.EventType type)
		{
			return !RequiresCarrierMovement(type);
		}
	}
}
